// components/order-item/order-item.js
const goods = require('../../api/goods')
Component({
  options: {
    multipleSlots: true // 在组件定义时的选项中启用多slot支持
  },
  /**
   * 组件的属性列表
   */
  properties: {
      goods: {type:Object,default: {}},
      stepperNum: {type: Number,default: 0},
      checkbox: {
          type: Boolean,
          default: true
      },

      isEditor: {
          type: Boolean,
          default: false
      },

      minNum: {
        type: [String, Number],
        default: 0
      },

      maxNum: {
        type: [String, Number],
      },

      stepper: {
        type: Boolean,
        default: true
      }
  },

  /**
   * 组件的初始数据
   */
  data: {
    IMAGE_PREFIX: goods.IMAGE_PREFIX
  },

  /**
   * 组件的方法列表
   */
  methods: {
    toGoods(){
      console.log(this.data.goods)
      if(this.data.goods.id){
        
        wx.navigateTo({url: `/subIndex/index/good-item/good-item?productId=${this.data.goods.id}`})
      }
    }
  }
})
